SL VI Mini Project

Stock Market Analysis

Group Id 3

Importing Libraries

Loading Data using NSEPy Library

Analyzing Dataset

Visualization using matplolib

Visualization using interactive graphs with plotly

Calculation to find the percent change for each day of stock

Visulaztion of Support And Resistance of Stock

The Resistance

As the name suggests, resistance is something which stops the price from rising further. The resistance level is a price point on the chart where traders expect maximum supply (in terms of selling) for the stock/index. The resistance level is always above the current market price.

The support

The support level is a price point on the chart where the trader expects maximum demand (in terms of buying) coming into the stock/index. Whenever the price falls to the support line, it is likely to bounce back. The support level is always below the current market price.

Comparing Banks stocks using Percentage Returns

Visualization of compared stocks using Seaborn

So now we know that if two stocks are perfectly (and positivley) correlated with each other a linear relationship bewteen its daily return values should occur. So let's go ahead and compare stocks with each other

It can be visulaized from the above plot that AXIS bank stock have higher risk but offers higher returns than other stocks whereas HDFC stock have lower risk but offers less return on its stock.

Correlational Analysis of SBI stock

Preparing and showing data for predictions

Building Linear Regression Model for Prediction

The term “linearity” in algebra refers to a linear relationship between two or more variables. If we draw this relationship in a two-dimensional space (between two variables), we get a straight line. Linear regression performs the task to predict a dependent variable value (y) based on a given independent variable (x).

Calculating RMSE MAE RMSE for evaluation of model

Randomforest Regressor

A random forest is a meta estimator that fits a number of decision tree classifiers on various sub-samples of the dataset and uses averaging to improve the predictive accuracy and control over-fitting. The sub-sample size is controlled with the max_samples parameter if bootstrap=True (default), otherwise the whole dataset is used to build each tree.

Calculating RMSE MAE RMSE for evaluation of model

Comparing RandomForest with linear Regressor

Support Vector Regressor

Support Vector Machine (SVM) is a relatively simple Supervised Machine Learning Algorithm used for classification and/or regression. It is more preferred for classification but is sometimes very useful for regression as well. Basically, SVM finds a hyper-plane that creates a boundary between the types of data. In 2-dimensional space, this hyper-plane is nothing but a line.

Calculating RMSE MAE RMSE for evaluation of model

Comparing all Machine Learning Models